package com.example.blog.common.page;

import java.util.List;

public class Page<T> {
    private int curPageSize;
    private int curPageNum;
    private int totalCount;
    private int totalPageCount;
    private boolean hasNextPage;
    private boolean hasPrePage;
    private List<T> objs;

    public Page(int curPageSize, int curPageNum, int totalCount, int totalPageCount, boolean hasNextPage, boolean hasPrePage, List<T> objs) {
        this.curPageSize = curPageSize;
        this.curPageNum = curPageNum;
        this.totalCount = totalCount;
        this.totalPageCount = totalPageCount;
        this.hasNextPage = hasNextPage;
        this.hasPrePage = hasPrePage;
        this.objs = objs;
    }

    public int getCurPageSize() {
        return curPageSize;
    }

    public void setCurPageSize(int curPageSize) {
        this.curPageSize = curPageSize;
    }

    public int getCurPageNum() {
        return curPageNum;
    }

    public void setCurPageNum(int curPageNum) {
        this.curPageNum = curPageNum;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPageCount() {
        return totalPageCount;
    }

    public void setTotalPageCount(int totalPageCount) {
        this.totalPageCount = totalPageCount;
    }

    public boolean isHasNextPage() {
        return hasNextPage;
    }

    public void setHasNextPage(boolean hasNextPage) {
        this.hasNextPage = hasNextPage;
    }

    public boolean isHasPrePage() {
        return hasPrePage;
    }

    public void setHasPrePage(boolean hasPrePage) {
        this.hasPrePage = hasPrePage;
    }

    public List<T> getObjs() {
        return objs;
    }

    public void setObjs(List<T> objs) {
        this.objs = objs;
    }

    @Override
    public String toString() {
        return "Page{" +
                "curPageSize=" + curPageSize +
                ", curPageNum=" + curPageNum +
                ", totalCount=" + totalCount +
                ", totalPageCount=" + totalPageCount +
                ", hasNextPage=" + hasNextPage +
                ", hasPrePage=" + hasPrePage +
                ", objs=" + objs +
                '}';
    }
}
